package com.bootcamp.s2_0922.ds.Exercise._1004_Ex;

import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Objects;
import java.util.Random;

/**
 * @program: myClassCode
 * @description:
 * @author: Keyu Li
 * @create: 2021-10-04 18:58
 **/

public class Ex1_BRBall {

    public static void main(String[] args) {
        // random number
        Random random = new Random();
        LinkedHashSet<Integer> balls = new LinkedHashSet<>();
        // add red balls
        for (int i = 0; i < 5; i++) {
            int number = random.nextInt(33) + 1;
            if (balls.contains(number))
                continue;
            balls.add(number);
        }
        // add blue balls
        balls.add(random.nextInt(16) + 1);
        // print red and blue balls
        System.out.println(balls);
    }
}

